/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Random;

/**
 * <p>Project: jse2204 - Random2
 * <p>Powered by webrx On 2022-08-31 16:34:05
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Random2 {
    public static void main(String[] args) {
        //产生5-10 随机整数
        for (int i = 0; i < 20; i++) {
            //int a = (int) Math.round(Math.random() * (10-5)) + 5;
            //System.out.println(a);
        }

        Random rand = new Random();
        for (int i = 0; i < 20; i++) {
            // 0 - 9
            //System.out.println(rand.nextInt(10));
            //5-10 随机整数
            //System.out.println(rand.nextInt(6) + 5);

            //5，11 不包括11（范围 5-10随机整数）
            System.out.println(rand.nextInt(5,11));
        }

        int num = rand.nextInt(1,101);
        System.out.println(num);
        //if(num<=30){
        if(rand.nextBoolean()){
            System.out.println("恭喜，中奖了....");
        }else{
            System.err.println("未中奖，多努力");
        }

        System.out.println("*".repeat(rand.nextInt(50)));


    }
}
